package operation.duoxianliu.demo04;

import java.util.ArrayList;
import java.util.Random;

public class Cjiangc implements Runnable {
    Random sc = new Random();
    int[] arr = {10, 5, 20, 50, 100, 200, 500, 800, 2, 80, 300, 700};
    int s = arr.length-1;
    private static int a;
    private static int b;


    @Override
    public void run() {
        while (true) {
            synchronized (Cjiangc.class) {
            if (s == -1) {
                    break;
                } else{
                    int num = sc.nextInt(12);
                    for (int i = 0; i < arr.length; i++) {
                        if (i==num && arr[i]==-1) {
                            System.out.println(Thread.currentThread().getName() + "抽奖箱产生了" + arr[i] + "元大奖");
                        }
                    }
                }


            }
        }
    }
}


